﻿using System;

namespace homework2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] array = new int[10];
            for (int i = 0; i < array.Length; i++)
            {
                Random rd = new Random();
                array[i] = rd.Next(1, 100);
            }
            Console.WriteLine("生成的随机数组为：");
            for (int i = 0; i < array.Length; i++)
            {
                Console.WriteLine(array[i]);
            }
            int Max = array[0];
            for(int i = 1; i < array.Length; i++)
            {
                if (Max < array[i])
                {
                    Max = array[i];
                }
            }
            Console.WriteLine("最大值为：" + Max);
            int Min = array[0];
            for (int i = 1; i < array.Length; i++)
            {
                if (Min > array[i])
                {
                    Min = array[i];
                }
            }
            Console.WriteLine("最小值为：" + Min);
            int sum = 0;
            for (int i = 0; i < array.Length; i++)
            {
                sum += array[i];
            }
            Console.WriteLine("总和为：" + sum);
            float avg =(float) sum / array.Length;
            Console.WriteLine("平均数为：" + avg);
        }
    }
}
